<template>
  <div>
    我叫{{ $store.state.GlobalData.name }} <br />
    今年{{ $store.state.GlobalData.age }}岁 <br />
    <br />
    <button @click="change">传值</button> <br />
    <br />
    <button @click="govite">去vite子系统</button>
  </div>
</template>

<script setup>
import { reactive, onMounted, getCurrentInstance } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useStore } from 'vuex'

const store = useStore()
const router = useRouter()

const change = () => {
  store.dispatch('setGlobalData', { name: '张三', age: 10 })
}
const govite = () => {
  router.push('/main/micro-vite/page1')
}
</script>
<style scoped></style>
